﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="com.IronOne.SLIC2.Lang" %>
<%  /// <summary>
    ///  <title></title>
    ///  <description>Partial View for Menu with the top search panel</description>
    ///  <copyRight>Copyright (c) 2013</copyRight>
    ///  <company>IronOne Technologies (Pvt) Ltd</company>
    ///  <createdOn>2013-01-10</createdOn>
    ///  <author></author>
    ///  <modification>
    ///     <modifiedBy></modifiedBy>
    ///      <modifiedDate></modifiedDate>
    ///     <description></description>
    ///  </modification>
    /// </summary> %>
<% 
    //string user = Session["LoggedUserDetail"].ToString();
    //com.IronOne.SLIC2.Models.EntityModel.User user = new com.IronOne.SLIC2.Controllers.BaseController().GetLoggedUserDetail();
    com.IronOne.SLIC2.Models.Administration.UserDataModel user = (Session["LoggedUserDetail"] != null) ? Session["LoggedUserDetail"] as com.IronOne.SLIC2.Models.Administration.UserDataModel : null;
    string actions = (user != null) ? user.RolePermissions : string.Empty;                       
%>
<ul class="nav">
    <%if (actions.Contains("Index_HTML"))
      { %>
    <li class="nav-icon">
        <%: Html.ActionLink(" ", "Index", "Default", null, new { @class = "icon-home" })%>
    </li>
    <%} %>
   <%-- <%if (actions.Contains("AdvancedSearch_HTML"))
      { %>
    <li class="dropdown">
        <%: Html.ActionLink(Resources.info_menu_jobs, "AdvancedSearch", "Job", null, new { @class = "dropdown-toggle" })%>
    </li>
    <%} %>   --%>

    
    <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
         <%:Resources.info_menu_jobs%><b class="caret"></b></a>
        <ul class="dropdown-menu">
            <%if (actions.Contains("AdvancedSearch_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_menu_jobSearch, "AdvancedSearch", "Job")%>               
            </li>
            <%} %>
              <%if (actions.Contains("TempDeleteJob_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_menu_tempdeleteJob, "TempDeleteJob", "Job")%>               
            </li>
            <%} %>
        </ul>
    </li>
<%--    <%if (actions.Contains("ViewReports_HTML"))
      { %>
    <li class="dropdown" style="display:none">
    <!--TODO: Remove display none after reports are done!!!! -->
    <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
         <%:Resources.info_menu_reports %>
        <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <%if (actions.Contains("AccessLogs_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_accessLogs, "AccessLogs", "Default")%></li>
            <%} %>
            <%if (actions.Contains("ReportInquery_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_inquireReports, "AdvancedSearch", "Job")%>
            </li>
            <%} %>
        </ul>
    </li>
    <%} %>--%>
    <%if (actions.Contains("Maintenance_HTML"))
      { %>
    <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
         <%:Resources.info_gen_administration%><b class="caret"></b></a>
        <ul class="dropdown-menu">
            <%if (actions.Contains("ViewRegions_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_regionManagement, "ViewRegions", "Admin")%>               
            </li>
            <%} %>
            <%if (actions.Contains("ViewBranches_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_branchManagement, "ViewBranches", "Admin")%></li>
            <%} %> <%if (actions.Contains("ViewUsers_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_menu_userManagement, "ViewUsers", "Admin")%></li>
            <%} %> <%if (actions.Contains("AuditLog_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_accessLogs, "AuditLog", "Report")%></li>
            <%} %> <%if (actions.Contains("LockedUsers_HTML") && actions.Contains("UnlockUsers_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_menu_unlockUsers, "LockedUsers", "Admin")%></li>
            <%} %>
     <%--       <li>
                <%: Html.ActionLink("Template View", "TemplateView", "Default")%></li>--%>
        </ul>
    </li>
    <%} %>
    <%if (actions.Contains("MyProfile_HTML"))
      { %>
    <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
         <%:Resources.info_menu_profile%>
        <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <%if (actions.Contains("ChangePassword_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_changePassword, "ChangePassword", "LogOn")%></li>
            <%} %>
            <%if (actions.Contains("UpdateProfile_HTML"))
              { %>
            <li>
                <%: Html.ActionLink(Resources.info_gen_updateProfile, "UpdateProfile", "Admin")%></li>
            <%} %>
        </ul>
    </li>
    <%} %>
</ul>
<%--<ul class="nav pull-right">    
    <li class="">
        <form class="navbar-search pull-left">
        <input type="text" class="search-query" placeholder="Search">
        <button class="search-btn">
            <i class="icon-search"></i>
        </button>
        </form>
    </li>   
</ul>--%>
